<?php
/*
 * @Created by: wangchengcheng
 * @Author: wangchengcheng
 * @Date: 2020-01-06 15:52:32
 * @LastEditors  : wangchengcheng
 * @LastEditTime : 2020-01-06 15:59:23
 */

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App;
use Auth;
use DB;
use Composer\Semver\Comparator;
use App\Models\SocialiteUser;


class IndexController extends Controller
{
    /**
     * 后台首页
     * 
     * @return mixed
     */
    public function index()
    {
        $socialiteUserData = SocialiteUser::select('name', 'avatar', 'login_times', 'updated_at')
            ->orderBy('updated_at', 'desc')
            ->limit(5)
            ->get();
        $version = [
            'system' => PHP_OS,
            'webServer' => $_SERVER['SERVER_SOFTWARE'] ?? '',
            'php' => PHP_VERSION,
            'mysql' => DB::connection()->getPdo()->query('SELECT VERSION();')->fetchColumn(),
        ];
        $assign = compact('socialiteUserData', 'version');

        return view('admin.index.index', $assign);
    }
}
